﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using iLangl.Model;
using System.Threading;


namespace iLangl.Tests.PushFixture
{
	[TestClass]
	public class PushDataModelTest : BaseTest
	{
		[TestMethod]
		public void PushDataModel()
		{
			Project project =  iLangl.BusinessModel.Managers.ProjectManager.Instance.GetProject(TestSettings.DefaultProjectId);

			Project tpproject = iLangl.LanguageWire.Managers.ProjectManager.Instance.GetProject(TestSettings.DefaultProjectId);

			project.Name = string.Format("Push Test Project {0}", DateTime.Now);

			Assert.AreNotEqual(project.Name, tpproject.Name);


			iLangl.BusinessModel.Managers.ProjectManager.Instance.UpdateProject(project);

			Thread.Sleep(5000);
			tpproject = iLangl.LanguageWire.Managers.ProjectManager.Instance.GetProject(TestSettings.DefaultProjectId);

			Assert.AreEqual(project.Name, tpproject.Name);
		}
	}
}
